package com.lujianbuping.system.opportunityprojectmanagementsystem.dao;

import com.lujianbuping.system.opportunityprojectmanagementsystem.entity.EmployeesEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface EmployeesMapper {

	/**
	 * 插入数据
	 * @param record
	 * @return
	 */
	int insert(EmployeesEntity record);

	int insertSelective(EmployeesEntity record);

	/**
	 * 主键删除
	 * @param id
	 * @return
	 */
//	@Delete("delete from opms_employees where id = ?")
	int deleteByPrimaryKey(String id);

	/**
	 * 通过主键查询
	 * @param id
	 * @return
	 */
//	@Select("select * from opms_employees where id = ?")
	EmployeesEntity selectByPrimaryKey(String id);

	/**
	 * 根据主键查询记录，然后将传入的其他属性修改
	 * 
	 * @param record
	 * @return
	 */
	int updateByPrimaryKeySelective(EmployeesEntity record);

	/**
	 * 跟据主键查询 然后将所有实体更改 慎用！！
	 * 
	 * @param record
	 * @return
	 */
	int updateByPrimaryKey(EmployeesEntity record);

	List<EmployeesEntity> selectAll(@Param("orderBy") String orderBy);

	List<EmployeesEntity> selectByKeyWithPagination(@Param("key") String key, @Param("pageNo") int pageNo,
                                                    @Param("pageSize") int pageSize);

}